﻿using HamcoWcs.Entitys.Bases;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace HamcoWcs.Entitys.UserInfos
{
    public class LoginStatus : AuditEntity, IEntityTypeConfiguration<LoginStatus>
    {
        public string UserName { get; set; }
        public string UserNo { get; set; }
        public string Ip { get; set; }
        public bool IsOnline { get; set; }
        public int Operate { get; set; }
        public string Token { get; set; }

        public string Desc { get; set; }

        public void Configure(EntityTypeBuilder<LoginStatus> builder)
        {
            builder.HasComment("登录信息表");
            builder.Property(x => x.UserName).IsRequired().HasMaxLength(50).HasComment("账户名称");
            builder.Property(x => x.UserNo).IsRequired().HasMaxLength(50).HasComment("账户");
            builder.Property(x => x.Ip).HasMaxLength(20).HasComment("IP");
            builder.Property(x => x.IsOnline).IsRequired().HasComment("状态：true在线，false离线");
            builder.Property(x => x.Operate).IsRequired().HasComment("操作");
            builder.Property(x => x.Token).HasMaxLength(100).IsRequired().HasComment("token");
            builder.Property(x => x.Desc).HasMaxLength(100).HasComment("描述");
        }
    }
}
